package cn.jia.hrm;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFfallbackFactory implements FallbackFactory<CourseESFeign> {

    @Override
    public CourseESFeign create(Throwable throwable) {
        return new CourseESFeign() {
            @Override
            public AjaxResult save(CourseDoc courseDoc) {
                return AjaxResult.me().setSuccess(false).setMessage("上传失败");
            }

            @Override
            public AjaxResult delete(Long id) {
                return AjaxResult.me().setSuccess(false).setMessage("下线失败");
            }
        };
    }
}
